﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using AspNetCs.Common;

public partial class PartsOfMemorialList : BasePage
{
    private int pageSize = 20;
    protected int recodCount = 0;
    private int province = 0;
    private int city = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if (!IsPostBack)
        {
            province = StringHelper.isNumber_int(Request["province"]);
            city = StringHelper.isNumber_int(Request["city"]);
            ViewState["province"] = province;
            ViewState["city"] = city;
            BindReapter();
        }
        else
        {
            if (ViewState["province"] != null)
            {
                province = StringHelper.isNumber_int(ViewState["province"].ToString());
            }
            if (ViewState["city"] != null)
            {
                city = StringHelper.isNumber_int(ViewState["city"].ToString());
            }
        }

    }


    public void BindReapter()
    {
        string cmdText = "select id,Numid,names,createname=(select username from users where userid=me.CreateId ),Addtime,hot from memorial as me where IsCheck=1 and Isdel=0 and IsWelfare=0 and province=" + this.province + " and city=" + this.city + " order by hot desc";
        DataPagesOperate operate = new DataPagesOperate();
        AspNetPager1.PageSize = pageSize;
        operate.BindRepeater(cmdText, AspNetPager1, "hot desc", "id", rptList, out recodCount);

    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        BindReapter();
    }
}
